package com.cntcdt.api.db.dao;

import java.util.List;

import com.cntcdt.api.db.dao.base.ConsociationCompanyMonthCntDaoBase;
import com.cntcdt.api.db.model.ConsociationCompanyMonthCntModel;

/**
 * 这是cdt_consociation_company_month_cnt的Dao实现类
 */
public class ConsociationCompanyMonthCntDao extends ConsociationCompanyMonthCntDaoBase   {
    /**
     * ConsociationCompanyMonthCntDao对象
     */
    private static ConsociationCompanyMonthCntDao instance = new ConsociationCompanyMonthCntDao();

    /**
     * 默认构造方法
     */
    private ConsociationCompanyMonthCntDao() {
    }

    /**
     * 获得对象实例
     */
    public static ConsociationCompanyMonthCntDao getInstance() { 
         return instance;
    } 
    
    /**
     * 分页查询
     * @param id id
     * @return model
     */
    public List<ConsociationCompanyMonthCntModel> findBySortTime(String consociationCompanyId,int shopId, long sortTime) {
        String sql = "SELECT * FROM " + TABLE + " WHERE consociationCompanyId in ("+consociationCompanyId+")  and shopId = ? and sortTime < ? order by sortTime desc limit 20";
       Object[] paramObjs = {shopId,sortTime};
       List<ConsociationCompanyMonthCntModel > modelList = this.queryModelList(sql, paramObjs);
       return modelList;
   } 

}
